﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Pibby.Core.Views;
using Pibby.Core.ViewModels;

namespace Pibby.Core.Tests.Stubs
{
	public class PodcastPropertiesView : GenericView, IPodcastPropertiesView
	{
		public event EventHandler<NewPodcastEventArgs> AcceptChanges;
		public event EventHandler DiscardChanges;

		public void ShowInfo(PodcastPropertiesViewModel vm)
		{
			this.ShowInfoCalled = true;
			this.Properties = vm;
		}

		public void SimulateAcceptChanges(string uri, string name)
		{
			this.ShowInfoCalled = false;

			if (this.AcceptChanges != null)
				this.AcceptChanges(this, new NewPodcastEventArgs(uri, name));
		}

		public void SimulateDiscardChanges()
		{
			this.ShowInfoCalled = false;

			if (this.DiscardChanges != null)
				this.DiscardChanges(this, EventArgs.Empty);
		}

		public bool ShowInfoCalled
		{
			get;
			private set;
		}

		public PodcastPropertiesViewModel Properties
		{
			get;
			private set;
		}
	}
}
